package com.youku.plugins.report.model
{
   import flash.utils.Dictionary;
   
   public class VideoSegmentReportData extends Object
   {
      
      public function VideoSegmentReportData() {
         super();
         this.init();
      }
      
      protected var _codeToCount:Dictionary;
      
      protected var _id:Number;
      
      protected function init() : void {
         this._codeToCount = new Dictionary();
         this._codeToCount["1001"] = 0;
         this._codeToCount["1002"] = 1;
         this._codeToCount["1003"] = 1;
         this._codeToCount["1004"] = 1;
         this._codeToCount["1005"] = 1;
         this._codeToCount["1006"] = 1;
         this._codeToCount["1007"] = 1;
         this._codeToCount["1008"] = 1;
         this._codeToCount["2001"] = 1;
         this._codeToCount["2002"] = 1;
         this._codeToCount["2003"] = 1;
         this._codeToCount["3001"] = 1;
         this._codeToCount["3002"] = 1;
         this._codeToCount["3003"] = 1;
         this._codeToCount["3004"] = 1;
         this._codeToCount["3005"] = 0;
         this._codeToCount["3006"] = 0;
         this._codeToCount["3007"] = 0;
         this._codeToCount["3008"] = 999;
         this._codeToCount["4001"] = 999;
         this._codeToCount["5000"] = 999;
      }
      
      public function isCodeCanBeSent(param1:String) : Boolean {
         if(this._codeToCount[param1] == null)
         {
            return false;
         }
         if(this._codeToCount[param1] <= 0)
         {
            return false;
         }
         if(param1 == "3004")
         {
            this.codeSent(param1);
            return false;
         }
         if(param1 == "3003" && (this._codeToCount["3008"] == 0 || this._codeToCount["3002"] == 0 || this._codeToCount["2002"] == 0 || this._codeToCount["3004"] == 0))
         {
            return false;
         }
         return true;
      }
      
      public function codeSent(param1:String) : void {
         if(param1 == "4001")
         {
            return;
         }
         this._codeToCount[param1]--;
         if(this._codeToCount[param1] < 0)
         {
            this._codeToCount[param1] = 0;
         }
      }
      
      public function get id() : Number {
         return this._id;
      }
      
      public function set id(param1:Number) : void {
         this._id = param1;
      }
   }
}
